package com.jvm.test3;

/**
 * <pre>
 *      测试垃圾回收器的引用计数器.
 *
 *      GC (System.gc()) [PSYoungGen: 3903K-856K(75776K) 3903K-864K(249344K), 0.0008266 secs Times: user=0.00 sys=0.00, real=0.00 secs
 *      Full GC (System.gc()) PSYoungGen: 856K-0K(75776K) ParOldGen: 8K-688K(173568K) 864K-688K(249344K), Metaspace: 3282K-3282K(1056768K), 0.0047862 secs Times: user=0.00 sys=0.00, real=0.01 secs
 *      Heap
 *          PSYoungGen      total 75776K, used 1951K [0x000000076b780000, 0x0000000770c00000, 0x00000007c0000000)
 *          eden space 65024K, 3% used [0x000000076b780000,0x000000076b967d60,0x000000076f700000)
 *          from space 10752K, 0% used [0x000000076f700000,0x000000076f700000,0x0000000770180000)
 *          to   space 10752K, 0% used [0x0000000770180000,0x0000000770180000,0x0000000770c00000)
 *      ParOldGen       total 173568K, used 688K [0x00000006c2600000, 0x00000006ccf80000, 0x000000076b780000)
 *          object space 173568K, 0% used [0x00000006c2600000,0x00000006c26ac1b8,0x00000006ccf80000)
 *      Metaspace       used 3300K, capacity 4496K, committed 4864K, reserved 1056768K
 *          class space    used 360K, capacity 388K, committed 512K, reserved 1048576K
 * </pre>
 *
 * @author : resty
 * @date : 2019年06月28日    15时
 **/
public class LogTest {
    LogTest lt ;
    public static void main(String[] args){
        //实例化两个对象
        LogTest lt1 = new LogTest();
        LogTest lt2 = new LogTest();
        //引用相互调用
        lt1.lt = lt2;
        lt2.lt = lt1;
        //清除引用
        lt1 = null;
        lt2 = null;
        //调用垃圾回收器
        System.gc();
    }
}
